package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Array7 {
    public static void main(String[] args) {
        int a[] = {12, 55, 10, 5, 14, 22, 23, 985, 52};
        int total = 0;
        for (int i : a) {
            total += i;
        }
        System.out.println(total);
        Scanner in = new Scanner(System.in);
        System.out.println("请输入要查找的数字：");
        int k = in.nextInt();
        boolean zai = false;//假定不在
        for (int i : a) {
            if (i == k) {
                //无法确定位置
                System.out.println("找到了");
                zai = true;
                break;
            }
        }
        if (!zai) {
            System.out.println("不在！");
        }
    }
}
